﻿using System;
using UnityEngine;

// Token: 0x02000576 RID: 1398
public class EyeHightLightYure : MonoBehaviour
{
	// Token: 0x060021AE RID: 8622 RVA: 0x00130D48 File Offset: 0x0012EF48
	public virtual void Start()
	{
		this._material = base.GetComponent<Renderer>().material;
		Texture mainTexture = this._material.mainTexture;
		this.textureWidth = mainTexture.width;
		this.textureHeight = mainTexture.height;
		float num = 0f;
		this.rect.y = num;
		this.rect.x = num;
		this.rect.width = (float)this.textureWidth;
		this.rect.height = (float)this.textureHeight;
		this.offset = new Vector2(0f, 0f);
		this.scale = new Vector2(1f, 1f);
		global::Debug.Log(this.textureWidth + "/" + this.textureHeight);
	}

	// Token: 0x060021AF RID: 8623 RVA: 0x00130E1C File Offset: 0x0012F01C
	public virtual void FixedUpdate()
	{
		if (this.eyeLookMaterialCtrl != null)
		{
			this.offset = this.eyeLookMaterialCtrl.GetEyeTexOffset();
		}
		this.rect.x = (float)UnityEngine.Random.Range(this.Inside, this.Outside);
		this.rect.y = (float)UnityEngine.Random.Range(this.Up, this.Down);
		this.offset += new Vector2(this.rect.x / (float)this.textureWidth, this.rect.y / (float)this.textureHeight);
		this.scale = new Vector2(this.rect.width / (float)this.textureWidth, this.rect.height / (float)this.textureHeight);
		this._material.SetTextureOffset("_MainTex", this.offset);
		this._material.SetTextureScale("_MainTex", this.scale);
	}

	// Token: 0x040029BE RID: 10686
	public global::EyeLookMaterialControll eyeLookMaterialCtrl;

	// Token: 0x040029BF RID: 10687
	public int Inside;

	// Token: 0x040029C0 RID: 10688
	public int Outside;

	// Token: 0x040029C1 RID: 10689
	public int Up;

	// Token: 0x040029C2 RID: 10690
	public int Down;

	// Token: 0x040029C3 RID: 10691
	public Rect rect;

	// Token: 0x040029C4 RID: 10692
	protected Material _material;

	// Token: 0x040029C5 RID: 10693
	protected int textureWidth;

	// Token: 0x040029C6 RID: 10694
	protected int textureHeight;

	// Token: 0x040029C7 RID: 10695
	protected Vector2 offset;

	// Token: 0x040029C8 RID: 10696
	protected Vector2 scale;
}
